<template>
  <div id="AnnouncementManagement">
    <div class="tops"><div><span  style="cursor: pointer;"  @click="handleclick">X</span></div></div>
    <div class="wrapper">
      <div class="head">
        <div class="title" v-html="form.title">标题</div>
        <!-- <p>尊敬的用户:</p>
        <p class="bom">您好!</p> -->
      </div>
      <div class="footer" v-html="form.content">内容</div>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "AnnouncementManagement",
  data() {
    return {
      serveUrl: "",
      form: {},
    };
  },
  computed: {
    ...mapState({
      uif: (state) => state.common.uif,
      userInfo: (state) => state.common.userInfo,
      tagCurrent: (state) => state.tag.tagCurrent,
    }),
  },
  methods: {
    // 获取页面数据
    async handleone() {
      const ret = await this.$api.Announcement.getSingleAnnouncement({ id: this.$route.query.id });
      this.form = ret.data.data.notice;
    },
    // 跳转回主页
    handleclick() {
      // this.$router.push('/enterprisePortal')
      this.$store.commit("DEL_TAG", this.tagCurrent);
      this.$router.back();
    },
    // 已读公告
    handleHaveRead() {
      this.$api.Announcement.getHaveRead({ nid: this.$route.query.id });
    },
  },
  activated() {
    this.handleone();
  },
  created() {
    this.handleHaveRead();
  },
};
</script>

<style lang="less" scoped>
#AnnouncementManagement {
  .tops {
    display: flex;
    flex-wrap: wrap; //允许换行
    width: 100%;
    height: 50px;
    line-height: 50px;
    div {
      margin-right: 20px;
      flex: 1;
      text-align: right;
      cursor: default;
    }
  }
  .wrapper {
    width: 50%;
    margin: 0 auto;
    .head {
      .title {
        width: 100%;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 50px;
      }
      .bom {
        margin-left: 40px;
        margin-top: 20px;
      }
    }
    :deep(.footer) {
      margin-top: 50px;
      table {
        border: none;
        border-collapse: collapse;
      }
      table td,
      table th {
        border: 1px solid #ccc;
        padding: 3px 5px;
        min-width: 50px;
        height: 20px;
      }
      table th {
        border-right: 1px solid #ccc;
        border-bottom: 2px solid #ccc;
        text-align: center;
        background-color: #f1f1f1;
      }
      blockquote {
        display: block;
        border-left: 8px solid #d0e5f2;
        padding: 5px 10px;
        margin: 10px 0;
        line-height: 1.4;
        font-size: 100%;
        background-color: #f1f1f1;
      }
      code {
        display: inline-block;
        *display: inline;
        *zoom: 1;
        background-color: #f1f1f1;
        border-radius: 3px;
        padding: 3px 5px;
        margin: 0 3px;
      }
      pre code {
        display: block;
      }
      ul,
      ol {
        margin: 10px 0 10px 20px;
      }
      pre {
        border: 1px solid #ccc;
        background-color: #f8f8f8;
        padding: 10px;
        margin: 5px 0px;
        font-size: 0.8em;
        border-radius: 3px;
      }
      .ql-editor ul li {
        list-style-type: disc; // 解决序列li前面的.不展示问题
      }
      .ql-editor ol li {
        list-style-type: decimal; // 解决序列li前面的数字不展示问题
      }
    }
  }
}
</style>
